package com.sanen.flyer.entity.heroBullet;

import com.sanen.flyer.common.Constant;
import com.sanen.flyer.entity.Bullet;
import com.sanen.flyer.entity.blast.Blast;
import com.sanen.flyer.entity.hero.Hero;
import com.sanen.flyer.factory.BlastFactory;

import java.awt.image.BufferedImage;

/**
 * @author wsse
 * @date 2018-09-19 19:59
 */
public class DaoDan extends Bullet{
    public DaoDan(BufferedImage image,Hero hero,int x,int y) {
        this.image=image;
        this.hero=hero;
        this.width= (int) (image.getWidth()* Constant.getRatio());
        this.height= (int) (image.getHeight()*Constant.getRatio());
        this.x=x-width/2;
        this.y=y-height/2;
        this.speedy=-10* Constant.getRatio();
        this.orientation=1;
        this.ap=30;
        this.paddingT= (int) (10* Constant.getRatio());
        this.paddingB= (int) (55* Constant.getRatio());
        this.paddingL= (int) (5* Constant.getRatio());
        this.paddingR= (int) (5* Constant.getRatio());
    }

    @Override
    public void logic() {
        this.y+=speedy;
    }

    @Override
    public void move() {

    }

    @Override
    public boolean outOfBounds() {
        return false;
    }

    @Override
    public boolean touchBounds() {
        return false;
    }

    @Override
    public Blast getBlast() {
        return BlastFactory.getBlast(BlastFactory.BLAST_BULLET,x+width/2,y+paddingT+10);
    }
}
